﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class but_TINTUC_NewsDetail : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string id = Request.QueryString["id"];
        if(!string.IsNullOrEmpty(id))
        {
            bindOtherNews("10", id);
        }
    }
    private void bindOtherNews(string num, string newsId)
    {
        TinTucDAO tinTucDao =new TinTucDAO();
        tinTucDao.NewsId = newsId;
        if (tinTucDao.getById())
        {
            lblTitle.Text = tinTucDao.Title;
            lblCreateDate.Text = tinTucDao.Createdate;
            lblContent.Text = tinTucDao.Content;
            rptTinBaiDaDang.DataSource = tinTucDao.News_getOtherByNewsId(num, newsId);
            rptTinBaiDaDang.DataBind();
            //MyWebUtils.MyWebUtil.goToElement(this.Page, "spanTitle");
        }
        else
        {
            Response.Redirect("Default.aspx");
        }
    }
}
